package com.framework.threadpool;

import com.framework.threadpool.reject.DiscardStartegy;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;

public class Main {

    public static void main(String[] args) {
        MyThreadPoolExecutor executor = new MyThreadPoolExecutor(2, 4, new ArrayBlockingQueue<>(2), 1, TimeUnit.SECONDS, new DiscardStartegy());
        for (int i = 0; i < 7; i++) {
            final String fi = i + "";
            executor.execute(() -> {
                System.out.println(Thread.currentThread().getName() + " " + fi);
            });
        }
    }
}
